﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace Admin
{
    public class GridviewInfo
    {
        static public GridViewRow GetGridViewRow(GridViewCommandEventArgs e)
        {
            GridViewRow currRow = null;
            //
            if (e.CommandSource is ImageButton)
            {
                currRow = (GridViewRow)((ImageButton)e.CommandSource).Parent.Parent;
            }
            //
            if (e.CommandSource is LinkButton)
            {
                currRow = (GridViewRow)((LinkButton)e.CommandSource).Parent.Parent;
            }
            //
            if (e.CommandSource is Button)
            {
                currRow = (GridViewRow)((Button)e.CommandSource).Parent.Parent;
            }
            //
            if (e.CommandSource is Image)
            {
                currRow = (GridViewRow)((Image)e.CommandSource).Parent.Parent;
            }
            

            //
            return currRow;
            //
        }
    }
}
